<?php
	error_reporting(0);
 	session_start();
	//数据库连接
 	$conn=mysql_connect('localhost','root','root');
 	mysql_select_db('itxmgl',$conn);
 	//定义常量
	define(ALL_PS,"PHP");
	mysql_query("set names 'utf8'");

	$jsonData= json_encode($_POST); 
    $objData=json_decode($jsonData);
    $keyword=$objData->{'keyword'}; 
	// $sql_show="SELECT * FROM `r_commodity` WHERE keyword='$img1' ";
    $keyword1=str_replace("./src/commodity/","","$keyword");
	$sql_show="SELECT * FROM `r_commodity` WHERE img1='$keyword1' ";

	$query_show=mysql_query($sql_show);
	while($result=mysql_fetch_array($query_show))
	{
		$arrayobject = new ArrayObject($result);
     	$array[] =  $arrayobject;
	}
	$tempArr = array('objectArray'=>$array,'img_folder'=>'./src/commodity/');
	$backData = json_encode($tempArr); 
	echo $backData; 
?>